import json
import os

# 设置当前的文件夹为‘E:\作业’
os.chdir(r"E:\作业")

books = [
    {"name": "三国演义",
     "price": 19.8
     },
    {"name": "金瓶梅",
     "price": 109.8
     }
]

# f = open("books.json", "a")
# bookStr = json.dumps(books, ensure_ascii=False)
# print(bookStr)
# f.write(bookStr)

with open("books.json","r",encoding='gbk') as f:
    result=json.load(f)
    print(type(result))



# json.dump(books,f,ensure_ascii=False)
# f.close()
